﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Wheeler.Web.ViewModels.UtilityModels
{
    public class PagerConfig
    {
        private int _pageNo = 1;
        private int _pageSize = 10;
        private int _numberOfPageLinkToDisplay = -1;
        private String _totalRecordMessage = "Total {0} record(s) found.";
        private String _noRecordMessage = "No Record Found.";

        public PagerConfig() { }
        public PagerConfig(int pageNo, int pageSize, int totalRecord)
        {
            this.PageNo = pageNo;
            this.PageSize = pageSize;
            this.TotalRecord = totalRecord;
        }
        public long TotalRecord
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or Sets the currently showing data page number
        /// </summary>
        public int PageNo
        {
            get { return _pageNo; }
            set { _pageNo = value; }
        }
        /// <summary>
        /// Gets or Sets the number of records to show in a data page
        /// </summary>
        public int PageSize
        {
            get { return _pageSize; }
            set { _pageSize = value; }
        }
        /// <summary>
        /// Gets or Sets total count of page links to display
        ///If the number of pages property is not set then
        ///return a default value
        /// </summary>
        public int NumberOfPageLinksToDisplay
        {
            get
            {                
                if (_numberOfPageLinkToDisplay <= 0)
                    return 5;

                return _numberOfPageLinkToDisplay;
            }
            set
            {
                _numberOfPageLinkToDisplay = value;
            }
        }
        public String TotalRecordMessage
        {
            get { return _totalRecordMessage; }
            set { _totalRecordMessage = value; }
        }

        public String UrlFormat { get; set; }
        public String NoRecordMessage 
        {
            get { return _noRecordMessage; }
            set { _noRecordMessage = value; }
        }
    }
}